<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="common/include :: header('新增客户')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-customer-add" th:object="${employee}" >
			<input class="form-control" type="hidden" name="id" id="id" th:value="${employee.id}" required>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">员工姓名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="name"th:field="*{name}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">员工性别：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="gander" id="gander" th:field="*{gander}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">员工年龄：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="age" id="age" th:field="*{age}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">员工email：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="email" id="email" th:field="*{email}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">入职日期：</label>
				<div class="col-sm-8">
					<div class="input-group date">
						<input name="hiredate" class="form-control" placeholder="yyyy-MM-dd" type="text" th:field="*{hiredate}">
						<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
					</div>
				</div>
			</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">入职部门：</label>
					<div class="col-sm-8">
						<select name="dept.id" class="form-control m-b" th:with="departments=${departments}">
							<option th:each="dept : ${departments}" th:text="${dept.name}" th:value="${dept.id}"th:field="*{dept.id}"></option>
						</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">员工状态：</label>
				<div class="col-sm-8">
				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
						<input type="radio" th:id="${dict.id}" name="status" th:value="${dict.value}" th:checked="${dict.isDefault}" th:field="*{status}">
						<label th:for="${dict.id}" th:text="${dict.label}"></label>
					</div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">超管否：</label>
				<div class="col-sm-8">
				    <div class="radio-box" th:each="dict : ${@dict.getType('si_visible')}">
						<input type="radio" th:id="${dict.id}" name="admin" th:value="${dict.value}"  th:field="*{admin}" th:checked="${dict.isDefault}">
						<label th:for="${dict.id}" th:text="${dict.label}"></label>
					</div>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="common/include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "/business/employee";

		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/edit", $('#form-customer-add').serialize());
	        }
	    }
	</script>
	<th:block th:include="common/include :: datetimepicker" />
	<script>
		$("input[name='hiredate']").datetimepicker({
			format: "yyyy-mm-dd",
			autoclose: true
		});
	</script>
</body>
</html>
